using System;
using System.Diagnostics;
using UnityEngine;
using UnityEngine.UI;
using QFramework;
using UnityEngine.SceneManagement;

namespace QFramework.Monk
{
	public class UIGamePassData : UIPanelData
	{
	}
	public partial class UIGamePass : UIPanel
	{
		protected override void OnInit(IUIData uiData = null)
		{
			mData = uiData as UIGamePassData ?? new UIGamePassData();
			// please add init code here
			ActionKit.OnUpdate.Register((() =>
			{
				if (Input.GetKeyDown(KeyCode.Space))
				{
					this.CloseSelf();
					AppStart.ChangeGameState(GameState.GameStart);
				}
			})).UnRegisterWhenGameObjectDestroyed((this.gameObject));
		}
		
		protected override void OnOpen(IUIData uiData = null)
		{
			//Time.timeScale = 0;
			AudioKit.PlaySound("game_pass");
		}
		
		protected override void OnShow()
		{
		}
		
		protected override void OnHide()
		{
		}
		
		protected override void OnClose()
		{
			//Time.timeScale = 1;
		}
		
	}
}
